function AudioAnalyser(audio)
{
    var context1;
    var source;
    var analyser;
    try
    {
        context1 = new (window.AudioContext || window.webkitAudioContext);
    }
    catch(e)
    {
        throw new Error('The Web Audio API is unavailable');
    }
    analyser=context1.createAnalyser();
    // 从audio标签获取声音源 source
    source = context1.createMediaElementSource(audio);
    source.connect(analyser);
    analyser.connect(context1.destination);
    return analyser
}
function audioBuffer(analyser,arrLen)
{
    var array =  new Uint8Array(arrLen);
    //复制当前的频率值到一个无符号数组中
    analyser.getByteFrequencyData(array);
    return array
}
